import { View, Text } from '@tarojs/components'
import Taro,{ useLoad } from '@tarojs/taro'
import './index.scss'

export default function Index () {
  useLoad(() => {
    console.log('Page loaded.')
    Taro.request({
      url: 'http://localhost:3000/api/user',
      method: 'GET',
      success: (res) => {
        console.log('res')
      },
      complete: () => {
        console.log('complete')
      }
    })
  })

  return (
    <View className='index'>
      <Text>Hello world!</Text>
    </View>
  )
}
